package com.xiaobai.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author yangdaji
 * @version 1.0 @Description:
 * @date 22-2-12 下午 3:42
 */
@Slf4j
@Controller
public class LoginController {

    // @Secured("ROLE_admin")
    @PreAuthorize("hasRole('admin')")
    @RequestMapping("/toMain")
    public String toMain() {
        return "redirect:main.html";
    }

    @RequestMapping("/toError")
    public String toError() {
        return "redirect:error.html";
    }

    @RequestMapping("/toMain2")
    public String toMain2() {
        return "thyme";
    }

    @RequestMapping("/showLogin")
    public String login() {
        return "tologin";
    }


}
